#include "StdAfx.h"
#include "MyButton.h"


MyButton::MyButton(void)
{
}


MyButton::~MyButton(void)
{
}


HWND MyButton::createButton(LPCWSTR text,int styles,int x, int y, int cx,int cy, HWND hParent, int id ,
	int nHeight,int fnWeight , BOOL fdwItalic , BOOL fdwUnderline, LPTSTR font, HINSTANCE hInst)
{
	InitCommonControls();

	hInstance = hInst;
	hButton = CreateWindow(TEXT("BUTTON"),  text, styles, x, y, cx, cy, hParent, (HMENU) id, hInst, NULL); 	

	HFONT hFont = CreateFont(nHeight,0,0,0,fnWeight,fdwItalic,fdwUnderline,0,VIETNAMESE_CHARSET,OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, VARIABLE_PITCH,font);

	SendMessage(hButton,WM_SETFONT,(WPARAM)hFont, 0);

	return hButton;
}

void MyButton::setText (LPWSTR text)
{
	SetWindowText(hButton,text);
}

HWND MyButton::getHandle()
{
	return hButton;
}

void MyButton::enable()
{
	EnableWindow(hButton,TRUE);
}


void MyButton::disable()
{
	EnableWindow(hButton,FALSE);
}


void MyButton::move(int x, int y, int cx, int cy)
{
	MoveWindow(hButton,x, y, cx, cy,TRUE);
}